﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EntGuayasSLA.BL;
using EntGuayasSLA.BL.Listas;
using EntGuayasSLA.BL.Listas.Criterias;
using Ext.Net;
using System.Configuration;

namespace EGuayas.Web.Licenciamiento.admin.tabs
{ 
    //Constantes.LCategorizacion
    public partial class pgCateg : pgBase
    {
          
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!X.IsAjaxRequest)
                {
                    var expLicId = Session[Constantes.LCategorizacion];
                    TabPanel1.CloseTab(4, CloseAction.Hide);
                    TabPanel1.CloseTab(3, CloseAction.Hide);
                    TabPanel1.CloseTab(2, CloseAction.Hide);
                  
                   
                    ComponentLoader myLoader = new ComponentLoader();
                    myLoader.Mode = LoadMode.Frame;
                    myLoader.Url = "pgTipoExPostExtPost.aspx?idExp=" + Session[SessionPage.PageLicAdm + Constantes.Expediente];
                    this.TabCong.Loader = myLoader;
                    this.TabPanel1.ShowTab("TabCong");
                    this.TabPanel1.SetActiveTab(0);
                 }
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }
        }

        [DirectMethod]
        public void ShowFecha()
        {
            wucFechaInsp.ShowFechaInspecion();

        }

        #region Informe
        /// <summary>
        /// Informes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OnInformeCorrecionAdded(object sender, ComponentAddedEventArgs e)
        {
            try
            {
                Ext.Net.Panel panel = (Ext.Net.Panel)e.Control;
                SetCustomConfigWucLicInforme(panel, SessionPage.PageLicAdm, Constantes.LCategorizacion,Valores.Modulo_Archivo_Informes_Licenciamiento);
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }
        }
        #endregion

        
        #region Documentos Licenciamiento
        /// <summary>
        /// Documentos correguir
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OnCorreguirDocCategoriaAdded(object sender, ComponentAddedEventArgs e)
        {
            try
            {
                Ext.Net.Panel panel = (Ext.Net.Panel)e.Control;
                SetCustomConfigWucLicAll(panel, SessionPage.PageLicAdm, Constantes.LCategorizacion);
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }
          
        }
        #endregion
       
        #region Tarea
        /// <summary>
        /// Inicializar constante de categoria
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OnTareasCategoriaAdded(object sender, ComponentAddedEventArgs e)
        {
            try
            {
                   Ext.Net.Panel panel = (Ext.Net.Panel)e.Control;
                   SetCustomConfigWucLicAll(panel, SessionPage.PageLicAdm,Constantes.LCategorizacion);
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }
       
        }
        
        #endregion

    }


}